package com.xidian.zhiancloud.ticketTemplate.ticketContentRisk;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;

public class TemporaryPowerJson extends TemplateJson{
    public static JsonNode TemporaryPower() {
        ObjectMapper mapper = new ObjectMapper();
        // 添加键值对。key是条目的名称，value也是HashMap类型的键值对
        HashMap<String, Object> t1 = new LinkedHashMap<>();

        List<HashMap<String, Object>> t2 = new LinkedList<>();
        HashMap<String, Object> m1 = new LinkedHashMap<>();
        m1.put("安装临时线路人员持有电工作业操作证", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m2 = new LinkedHashMap<>();
        m2.put("在防爆场所使用的临时电源、元器件和线路达到相应的防爆等级要求", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m3 = new LinkedHashMap<>();
        m3.put("临时用电的单项和混用线路采用五线制", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m4 = new LinkedHashMap<>();
        m4.put("临时用电线路在装置内不低于2.5m，道路不低于5m", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m5 = new LinkedHashMap<>();
        m5.put("临时用电线路架空进线未采用裸线，未在树或脚手架上架设", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m6 = new LinkedHashMap<>();
        m6.put("暗管埋设及地下电缆线路设有“走向标志”和“安全标志”，电缆埋深大于0.7m", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m7 = new LinkedHashMap<>();
        m7.put("现场临时用配电盘、箱有防雨措施", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m8 = new LinkedHashMap<>();
        m8.put("临时用电设施装有漏电保护器，移动工具、手持工具“一机一闸一保护”", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m9 = new LinkedHashMap<>();
        m9.put("有点设备、线路容量、负荷符合要求", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m10 = new LinkedHashMap<>();
        m10.put("临时用电线使用橡胶套", getFiled("确认人", "String", 0, new String[]{}));
        HashMap<String, Object> m11 = new LinkedHashMap<>();
        m11.put("其他安全措施：", getFiled("确认人", "String", 0, new String[]{}));

        t2.add(m1);
        t2.add(m2);
        t2.add(m3);
        t2.add(m4);
        t2.add(m5);
        t2.add(m6);
        t2.add(m7);
        t2.add(m8);
        t2.add(m9);
        t2.add(m10);
        t2.add(m11);

        t1.put("safe_measure", getFiled("安全措施", "string", 0, t2));
        JsonNode jsonNode = mapper.valueToTree(t1);
        System.out.println(jsonNode);
        return jsonNode;
    }
}
